<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改入职申请')" />
    <th:block th:include="include :: datetimepicker-css" />
    <link th:href="@{/ajax/libs/layui/css/layui.css}" rel="stylesheet"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-manager-edit" th:object="${nonManager}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">入职人姓名：</label>
                <div class="col-sm-8">
                    <input name="empName" th:field="*{empName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">入职日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="nonManagerDate" th:value="${#dates.format(nonManager.nonManagerDate, 'yyyy-MM-dd')}" class="form-control" readonly="readonly" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">入职部门：</label>
                <div class="col-sm-8">
                    <!--<input name="nonManagerDeptId" th:field="*{nonManagerDeptId}" class="form-control" type="text" required>-->
                    <select id="nonManagerDeptId" name="nonManagerDeptId" class="form-control m-b" th:with="deptAll=${@deptService.getDeptAll()}" required>
                        <option value="">所有</option>
                        <option th:each="dept : ${deptAll}" th:text="${dept.getShowName()}" th:field="*{nonManagerDeptId}" th:value="${dept.getDeptId()}"  th:hidden="${dept.getStatus() == '1' || dept.getDelFlag() != '0' }"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">入职岗位：</label>
                <div class="col-sm-8">
                    <!--<input name="nonManagerPostId" th:field="*{nonManagerPostId}" class="form-control" type="text" required>-->
                    <select id="nonManagerPostId" name="nonManagerPostId" class="form-control m-b" th:with="postAll=${@postService.getPostAll()}" required>
                        <option value="">请选择</option>
                        <option th:each="post : ${postAll}" th:text="${post.getPostName()}" th:value="${post.getPostId()}"  th:hidden="${post.getStatus() == '1'}" th:field="*{nonManagerPostId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">入职城市：</label>
                <div class="col-sm-8">
                    <select id="citys" name="citys" class="form-control m-b" th:with="type=${@dict.getType('citys')}" disabled>
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:selected="${dict.dictValue == nonManager.citys}" th:value="${dict.dictValue}" ></option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">是否主管级及以上：</label>
                <div class="col-sm-8" style="margin-top: 5px">
                    <div class="">
                        否<input type="radio" name="isManager" value="0" th:checked="*{isManager == '0'}" required>&nbsp;&nbsp;&nbsp;&nbsp;
                        是<input type="radio" name="isManager" value="1" th:checked="*{isManager == '1'}" required>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">相关证明：</label>
                <div class="col-sm-8">
                    <div class="layui-upload-list">
                        <table class="layui-table">
                            <thead>
                            <tr><th>文件</th>

                                <th>操作</th>
                            </tr></thead>
                            <tbody id="demoListOld" >
                            <tr th:each="img : *{imgList}"  th:id="${#strings.substring(img,30,45)}">
                                <td th:text="${#strings.substring(img,27,63)}"></td>

                                <td><a class="layui-btn layui-btn-xs layui-btn-danger" th:href="${img}">下载</a></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>


            <div class="container-div"  style="height: initial;">
                <div class="row">
                    <div class="col-sm-12 search-collapse" hidden>
                        <form id="role-form">
                            <input type="hidden" id="instanceId" name="instanceId" th:value="${nonManager.instanceId}">
                            <div class="select-list">
                                <ul>
                                    <li>
                                        任务名称：<input type="text" name="activityName"/>
                                    </li>
                                    <li>
                                        办理人ID：<input type="text" name="assignee"/>
                                    </li>
                                    <li>
                                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('role-form' , 'bootstrap-table' )"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                        <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('role-form' , 'bootstrap-table')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                    </li>
                                </ul>
                            </div>
                        </form>
                    </div>

                    <div class="col-sm-12 select-table ">
                        <table id="bootstrap-table" ></table>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "hr/manager";
        $("#form-manager-edit").validate({
            focusCleanup: true
        });

        for (var i = 0; i < document.getElementsByTagName("input").length; i++) {
            document.getElementsByTagName("input")[i].disabled = true;
        }
        for (var i = 0; i < document.getElementsByTagName("textarea").length; i++) {
            document.getElementsByTagName("textarea")[i].disabled = true;
        }
        for (var i = 0; i < document.getElementsByTagName("select").length; i++) {
            document.getElementsByTagName("select")[i].disabled = true;
        }
        $("input[name='nonManagerDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='birthday']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>